package com.julius.design.pattern.factory.ab;

import com.julius.design.pattern.factory.normal.UserFactory;

/**
 * <p>
 *      工厂生产者
 * </p>
 */
public class FactoryProducer {


    /**
     * 生产工厂
     * @param name
     * @return
     */
    public static AbstractFactory getFactory(String name) {
        if ("user".equalsIgnoreCase(name)){
            return new UserFactory();
        }
        if ("order".equalsIgnoreCase(name)) {
            return new OrderFactory();
        }
        
        return null;
    }
}
